//引入http模块
const http = require('http');
const url = require('url');
const querystring = require('querystring')
//创建网站服务器对象
const app = http.createServer();
app.on('request',(req, res)=>{
    let postParams = '';
    req.on('data',params=>{
        postParams += params;
    });
    req.on('end',()=>{
        console.log(querystring.parse(postParams))
    });
    res.end('ok')
});
//监听窗口，没有这个无法访问
app.listen(3000);
console.log('网站服务器启动成功')